<?php
/**
 * @package    Joomla.Site
 *
 * @copyright  Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
 * @license    GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

// Global definitions
$parts = explode(DIRECTORY_SEPARATOR, JPATH_BASE);
define('DS', DIRECTORY_SEPARATOR);

// Defines.
define('JPATH_ROOT',          implode(DIRECTORY_SEPARATOR, $parts));
define('JPATH_SITE',          JPATH_ROOT);
define('JPATH_CONFIGURATION', JPATH_ROOT);
define('JPATH_ADMINISTRATOR', JPATH_ROOT . '/administrator');
define('JPATH_LIBRARIES',     JPATH_ROOT . '/libraries');
define('JPATH_PLUGINS',       JPATH_ROOT . '/plugins');
define('JPATH_INSTALLATION',  JPATH_ROOT . '/installation');
define('JPATH_THEMES',        JPATH_BASE . '/templates');
define('JPATH_CACHE',         JPATH_BASE . '/cache');
define('JPATH_MANIFESTS',     JPATH_ADMINISTRATOR . '/manifests');
define('CUSTOM_PATH', JPATH_ROOT.'/custom');
define('CUSTOM_PATH_PHP_LIB', CUSTOM_PATH.'/lib/php');
define('CUSTOM_PATH_OPERATIONS', CUSTOM_PATH.'/operations');
define('CUSTOM_PATH_PANIERS', CUSTOM_PATH.'/paniers');
define('CUSTOM_PATH_INVOICES_HELPER', JPATH_ROOT . '/components/com_invoices/helpers');

//URL for HTML inclusion
$jPathRoot = str_replace ('\\' , '/', JPATH_ROOT);
$documentRoot = str_replace ('\\' , '/' , $_SERVER['DOCUMENT_ROOT']);
$relativeJPath = str_replace ($documentRoot, '', $jPathRoot);
if (substr($relativeJPath, 0,1) !== '/') $relativeJPath = '/'.$relativeJPath;

define('URL_JPATH_ROOT', $relativeJPath);
define('URL_CUSTOM_PATH', URL_JPATH_ROOT.'/custom');
define('URL_IMAGES_PANECO_PATH', URL_JPATH_ROOT.'/images/paneco');
define('URL_LIB_PATH', URL_JPATH_ROOT.'/../lib');
define('URL_LIB_DHTMLX_GRID_CODEBASE', URL_LIB_PATH.'/dhtmlxSuite/dhtmlxGrid/codebase');
define('URL_LIB_DHTMLX_SCHEDULER_CODEBASE', URL_LIB_PATH.'/dhtmlxSuite/dhtmlxScheduler/codebase');
define('URL_LIB_DHTMLX_CALENDAR_CODEBASE', URL_LIB_PATH.'/dhtmlxSuite/dhtmlxCalendar/codebase');
define('URL_LIB_DHTMLX_CALENDAR_SKINS', URL_LIB_PATH.'/dhtmlxSuite/dhtmlxCalendar/skins');
define('URL_LIB_DHTMLX_AJAX_CODEBASE', URL_LIB_PATH.'/dhtmlxSuite/dhtmlxAjax/codebase');
define('URL_LIB_HANDSONTABLE', URL_LIB_PATH.'/handsontable');
define('URL_CUSTOM_JS_LIB', URL_CUSTOM_PATH.'/lib/js');
define('URL_CUSTOM_PHP_LIB', URL_CUSTOM_PATH.'/lib/php');
define('URL_CUSTOM_OPERATIONS', URL_CUSTOM_PATH.'/operations');
define('URL_CUSTOM_PANIERS', URL_CUSTOM_PATH.'/paniers');
define('URL_AJAX_CALLBACK_FUNCTION', URL_CUSTOM_PHP_LIB.'/ajaxcallback.php');